

import requests
import re
import execjs

headers = {
    'user-agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Mobile Safari/537.36 Edg/84.0.522.40'
}

post_url = 'https://fanyi.baidu.com/basetrans'

data = {
    'query': '人生',
    'from': 'zh',
    'to': 'en',
    'token': '925dae230df7b25f6d430eb96a41a180',
    'sign': '548627.834594'
}

r = requests.post(post_url, headers=headers, data=data)

print(r.content.decode())